//this is admin login document
function login2(){
	doLogin("/networkforum/main/control_login.do",function(d){
		if(d == "true"){
			window.location = "/forumcontrol/control_main.html";
		}else if(d == "false"){
			alert("用户名密码错误或!");
		}else if(d == "noPower") {
			alert("对不起，你的用户无此权限!")
		}
	});
}


function doLogin(url,callBack){
	var userName = document.getElementById("userName").value;
	var userPassword = document.getElementById("userPassword").value;
	if(userName == "" || userPassword == ""){
		alert("请先输入用户名和密码");
		return;
	}
	var data = [{"name":"userName","value":userName},
	    		{"name":"userPassword","value":userPassword}];
	var myajax = getByAjax();
	myajax.init(data,"get",true);
	myajax.get(url,callBack);
	myajax = null;
}